from api.ihrm_depart_api import IhrmDepartApi
from common.token_util import TokenUtil


class DepartUtil:
    @classmethod
    def get_departId(cls):
        token = TokenUtil.get_token()
        add_body = {"name": "测试01", "code": "123456"}
        add_resp = IhrmDepartApi.add_api(token, add_body)
        depart_id = add_resp.json().get("data").get("id")
        return depart_id


if __name__ == '__main__':
    print(DepartUtil.get_departId())
